'''
requests.post()
【1.传form-data】

2.传x-www-form-urlencoded

3.传json
'''
import requests

if __name__ == '__main__':
    headers = {
        'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36'
    }
    params ={
        'type': '1',
        'typeID': 'MbKpY9nLad'
    }
    cooks = '''BIDUPSID=C86FCDFB628DCF49DB44DB7A99C2ED40; PSTM=1645609221; REALTIME_TRANS_SWITCH=1; HISTORY_SWITCH=1; FANYI_WORD_SWITCH=1; SOUND_SPD_SWITCH=1; SOUND_PREFER_SWITCH=1; MCITY=-146%3A; Hm_lvt_64ecd82404c51e03dc91cb9e8c025574=1709861936; BDUSS=NGNWI3bmFMfk1hckE5RGY2V2lsVX41R1FNbnVHUi1tUWxtVmlYa3pFc2ZvNmxtSVFBQUFBJCQAAAAAAAAAAAEAAADIsUIPczk4MDMwMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB8WgmYfFoJmSn; BDUSS_BFESS=NGNWI3bmFMfk1hckE5RGY2V2lsVX41R1FNbnVHUi1tUWxtVmlYa3pFc2ZvNmxtSVFBQUFBJCQAAAAAAAAAAAEAAADIsUIPczk4MDMwMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB8WgmYfFoJmSn; BAIDUID=EE6D308F71FFCF91D4F4AE022A537E24:SL=0:NR=10:FG=1; H_PS_PSSID=60360_60598_60724_60798; H_WISE_SIDS=60360_60598_60724_60798; H_WISE_SIDS_BFESS=60360_60598_60724_60798; BA_HECTOR=81000g012k8k8h0ha00k0l8hbe060o1jedmcb1u; ZFY=mowMbKCUZH5GCC89nw7PPtE0acVb4R7YW9Vvhzwf7C8:C; BAIDUID_BFESS=EE6D308F71FFCF91D4F4AE022A537E24:SL=0:NR=10:FG=1; delP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gTa54cbb4o2WbCQQ-KW8pcN2b5oQTJQ3xRI-p3f2Tr4aPbwahQbeq06-lOUWJDkXpJvQnJjt2JxaqRC5nQzEl5jDh3MKToDb-oteltHB2Oy0hvcQb5cShn9jKcrbn3XjUCtLt3kW-jmKh67LDnUO-bIe-t2XjQhDH-OJ6DHtJ3aQ5rtKRTffjrnhPF33h_zXP6-hnjy3bAj-JvlbUbbqP5HybOZhUKWbttf5q3Ry6r42-39LPO2hpRjyxv4b-KPL4oxJpOJ-bCL0p5aHx8K8p7vbURv3PLg3-7OtIrd55PH_bFaQJbZOT6JQUcr06kvyhOhqP-jBRIE3-oJqCDhhD-l3D; ab_sr=1.0.1_NDg2YzEyMTYyMDA2ZDJjMDc1MDZjY2UxZTFlMjQ4MWQwZWE5MTcxMzU2ZDYyYjgyNzJlYWJiNzZmZGFlMzA1YTMwZWFiNTBhYjQxOGE4ODFkMmJjMzNmZTEyMzBjODg3NjkwMDQ1NWMxYjQyNjdlODc5YTAzY2Q5YWZjYTBjZWQ2Y2RhYjAwMjMyMjAyN2Y1Njc2MmRjYzVjYzQwNTViOTdmOWY1MzE5ZjBhNDZhYzE0NTYwMjQ2NDdiZWJkN2EzNTk1NWNhMjhjNDRlN2MzNzczMmQzNzcwNzM2YjFjOWI=; RT="z=1&dm=baidu.com&si=18dc90ac-ed9a-4427-91f7-e5969e03a33c&ss=m13q1nvp&sl=a&tt=18t6&bcn=https%3A%2F%2Ffclog.baidu.com%2Flog%2Fweirwood%3Ftype%3Dperf&ld=g99j"'''
    cookies = {}
    key_values = cooks.split(';')
    for key_value in key_values:
        arr = key_value.split('=')
        cookies[arr[0]] = arr[1]
    response = requests.post('https://fanyi.baidu.com/ai/history/copilot', params, headers=headers , cookies=cookies)

    print(response.text)
